import style from './style.module.scss'

const List = ({ schema }) => {
  const { children = [] } = schema
  return (
    <div className={style.courses}>
      <ul className={style.list}>
        {children.map(
          ({ attributes: { title, description, imageUrl } }, index) => (
            <li className={style.item} key={index}>
              <img className={style.img} src={imageUrl} alt={title} />
              <h4 className={style.title}>{title}</h4>
              <p className={style.desc}>{description}</p>
            </li>
          )
        )}
      </ul>
    </div>
  )
}

export default List
